package com.globalwave.common.task;

import com.globalwave.common.scheduling.RunnableTask;

public class TestTask extends RunnableTask {

	@Override
	public void execute() throws Exception {
    	
        for (int i = 0 ; i < 5 ; i ++) {
        	
        	if(this.isCanceled()) {
            	System.err.println("TestTask  is canceled - " + i);
        		return ;
        	}
        	
        	System.err.println("TestTask - " + i);
        	try {
		        //System.err.println("interrupted = " + Thread.interrupted());
				Thread.sleep(10*1000);
			} catch (InterruptedException e) {
				e.printStackTrace();
		        //System.err.println("interrupted = " + Thread.interrupted());
				return ;
			}
        }
        //System.err.println("interrupted = " + Thread.interrupted());
	}

}
